home *** CD-ROM | disk | FTP | other *** search
/ autoKOLEKCIJA 2005 April / My Disc.iso / automobiliai / Unit2.~cpp < prev    next >
Encoding:
Text File  |  2004-05-03  |  1.7 KB  |  59 lines

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #include <stdio.h>
  5. #include <io.h>
  6. #include <dir.h>
  7. #pragma hdrstop
  8.  
  9. #include "Unit1.h"
  10. #include "Unit2.h"
  11. #include <stdlib.h>
  12. #include <shellapi.hpp>
  13. #include <windows.h>
  14. //---------------------------------------------------------------------------
  15. #pragma package(smart_init)
  16. #pragma resource "*.dfm"
  17. TForm2 *Form2;
  18. //---------------------------------------------------------------------------
  19. __fastcall TForm2::TForm2(TComponent* Owner)
  20.         : TForm(Owner)
  21. {
  22. }
  23. //---------------------------------------------------------------------------
  24. void __fastcall TForm2::Button1Click(TObject *Sender)
  25. {
  26. CreateDir("C:\\mobilis_temp");
  27. Image1->Picture->SaveToFile ("C:\\mobilis_temp\\pic.jpg");
  28.     TJPEGImage *jpg = new TJPEGImage();
  29.     Graphics::TBitmap* bmp = new Graphics::TBitmap();
  30.     try
  31.     {
  32.         jpg->LoadFromFile("C:\\mobilis_temp\\pic.jpg");
  33.         bmp->Assign(jpg);
  34.         //--------------------------------------------------------------
  35.         bmp->SaveToFile("C:\\mobilis_temp\\pic.bmp");
  36.     }
  37.     __finally
  38.     {
  39.         delete jpg;
  40.         delete bmp;
  41.     }
  42.  
  43. SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\\mobilis_temp\\pic.bmp", SPIF_UPDATEINIFILE);
  44. }
  45. //---------------------------------------------------------------------------
  46.  
  47. void __fastcall TForm2::Button2Click(TObject *Sender)
  48. {
  49. Close();        
  50. }
  51. //---------------------------------------------------------------------------
  52.  
  53. void __fastcall TForm2::Image1Click(TObject *Sender)
  54. {
  55. Close();        
  56. }
  57. //---------------------------------------------------------------------------
  58.  
  59.